import Moment from 'moment';

let option_datetimePicker = {
  shortcuts: [
    {
      text: '今日',
      onClick(picker) {
        picker.$emit('pick', [
          Moment({ hour: 0, minute: 0, seconds: 0 }),
          Moment({ hour: 23, minute: 59, seconds: 59 }),
        ]);
      }
    },
    {
      text: '昨日',
      onClick(picker) {
        picker.$emit('pick', [
          Moment({ hour: 0, minute: 0, seconds: 0 }).subtract({ days: 1 }),
          Moment({ hour: 23, minute: 59, seconds: 59 }).subtract({ days: 1 }),
        ]);
      }
    },
    {
      text: '近三日',
      onClick(picker) {
        picker.$emit('pick', [
          Moment({ hour: 0, minute: 0, seconds: 0 }).subtract({ days: 3 }),
          Moment({ hour: 23, minute: 59, seconds: 59 }).subtract({ days: 1 }),
        ]);
      }
    },
    {
      text: '近五日',
      onClick(picker) {
        picker.$emit('pick', [
          Moment({ hour: 0, minute: 0, seconds: 0 }).subtract({ days: 5 }),
          Moment({ hour: 23, minute: 59, seconds: 59 }).subtract({ days: 1 }),
        ]);
      }
    },
    {
      text: '近七日',
      onClick(picker) {
        picker.$emit('pick', [
          Moment({ hour: 0, minute: 0, seconds: 0 }).subtract({ days: 7 }),
          Moment({ hour: 23, minute: 59, seconds: 59 }).subtract({ days: 1 }),
        ]);
      }
    },
    {
      text: '最近一个月',
      onClick(picker) {
        picker.$emit('pick', [
          Moment({ hour: 0, minute: 0, seconds: 0 }).subtract({ months: 1 }).startOf('month'),
          Moment({ hour: 23, minute: 59, seconds: 59 }).subtract({ months: 1 }).endOf('month'),
        ]);
      }
    },
    {
      text: '最近三个月',
      onClick(picker) {
        picker.$emit('pick', [
          Moment({ hour: 0, minute: 0, seconds: 0 }).subtract({ months: 3 }).startOf('month'),
          Moment({ hour: 23, minute: 59, seconds: 59 }).subtract({ months: 1 }).endOf('month'),
        ]);
      }
    }
  ]
}
let option_hmsPicker = {
  start: '00:00',
  end: '23:59',
  step: '00:01',
  format: 'H:m:s'
}




export {
  option_datetimePicker,
  option_hmsPicker,
}

